package edu.upol.paradise.compiler;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class Keywords {
	
	private static Set<String> KEYWORD_SET_INTERNAL = new HashSet<String>();
	public static Set<String>  KEYWORD_SET;
	
	// Elevated runtime only
	public static final String PRINT = "!PRINT";
	public static final String PRINTLN = "!PRINTLN";
	public static final String LAMBDA = "!LAMBDA";
	public static final String DEFINE = "!DEFINE";
	
	// Elevated and slave runtime 
	public static final String PROGN = "PROGN";
	public static final String QUOTE = "QUOTE";
	public static final String IF 	 = "IF";
	public static final String EQ 	 = "EQ";
	public static final String EQUALS= "EQUALS";
	public static final String ERROR = "ERROR";
	public static final String SET   = "SET";
	public static final String WHILE = "WHILE";
	
	
	static {
		addKeyword(PRINT);
		addKeyword(PRINTLN);
		addKeyword(LAMBDA);
		addKeyword(DEFINE);
		
		addKeyword(PROGN);
		addKeyword(QUOTE);
		addKeyword(IF);
		addKeyword(EQ);
		addKeyword(EQUALS);
		addKeyword(ERROR);
		addKeyword(SET);
		addKeyword(WHILE);
		
		KEYWORD_SET = Collections.synchronizedSet(Collections.unmodifiableSet(KEYWORD_SET_INTERNAL));
	}


	private static void addKeyword(String k) {
		KEYWORD_SET_INTERNAL.add(k);
	}
}
